package com.chinaway.mobile.dao.impl;

import java.util.List;

import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;

import com.chinaway.base.BaseSpringJdbcDao;
import com.chinaway.mobile.dao.SimbalanceworkDao;
import com.chinaway.mobile.model.Simbalancework;

public class SimbalanceworkDaoJdbc extends BaseSpringJdbcDao<Simbalancework, Long> implements	SimbalanceworkDao {

	private static String SQL_UPDATE = "update sim_balance_work set result=:result,isok=:isok," +
			"updatetime = now() where sim = :sim";

	@Override
	public void update(Simbalancework simbalancework){
		getNamedParameterJdbcTemplate().update(SQL_UPDATE, new BeanPropertySqlParameterSource(simbalancework));
	}
	
	private static String SQL_FINDBY = "SELECT *  FROM sim_balance_work   where workid = ?";
	@Override
	public List<Simbalancework> findby(Long workid){
		return (List<Simbalancework>)getSimpleJdbcTemplate().query(SQL_FINDBY, mapper, workid);
	}

}
